/* Wasson An
 * This class contains defines the actor which just exists at a point
 */

package catandmouse;

public class Actor {

	private Coordinate position; //the position of the actor
	private int width;
	private int height;
	
	//2 parameter constructor
	public Actor(int x, int y, int w , int h){
		
		position = new Coordinate(x, y);
		width = w;
		height = h;
	}//int int constructor
	
	
	//returns the current position of the actor
	public Coordinate getPosition(){
		
		return position;
	}//getPosition
	
	
	//moves the actor vertically
	public void moveVertical(int d){
		
		int y = position.getY();
			
		if(y + d < 5)
			position.setY(5);
		
		else if(y + d > height- 43)
			position.setY(height - 43);
		
		else
			position.setY(y + d);
	}//moveVertical
	
	
	//moves the actor horizontally
	public void moveHorizontal(int d){
		
		int x = position.getX();	
		
		if(x + d < 5)
		position.setX(5);
		
		else if(x + d > width - 20)
			position.setX(width - 20);
	
		else
			position.setX(x + d);
	}//moveHorizontal
}//Actor
